# Maintainer: David Runge <dvzrv@archlinux.org>

_name=sphinxygen
pkgname=python-sphinxygen
pkgver=1.0.4
pkgrel=1
pkgdesc="A script to read Doxygen XML output and emit ReST for Sphinx"
arch=(any)
url="https://gitlab.com/drobilla/sphinxygen"
license=('0BSD or ISC')
depends=(python)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  doxygen
  python-html5lib
  python-sphinx
)
optdepends=(
  'python-html5lib: for HTML5 support'
)
source=($url/-/archive/v$pkgver/$_name-v$pkgver.tar.gz)
sha512sums=('38ac258850fe6ab38e88c7b59d41e1400b89b13443862a0a9e7c7d1a2e3b887660f1cb17ce94737bc6366025172b40a50da0107d970120610fc9410f41c3250c')
b2sums=('48c99ba80ebdc9f2ed9ef147d8d7c4f0deb7d4e1118ff6969cf510a0a10bc2335fa9ba91fb38caf60b8770a023e7a0730efa0a5606726dd1d0292650374d9271')
validpgpkeys=()

build() {
  cd $_name-v$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-v$pkgver
  python -m unittest discover

}

package() {
  cd $_name-v$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSES/* -t "$pkgdir/usr/share/licenses/$pkgname/"
}
